
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>API规范 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="ajax.html" />
    
    
    <link rel="prev" href="directory.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="directory.html">
            
                <a href="directory.html">
            
                    
                    目录规划
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.3" data-path="api.html">
            
                <a href="api.html">
            
                    
                    API规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="ajax.html">
            
                <a href="ajax.html">
            
                    
                    ajax请求
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="vuex.html">
            
                <a href="vuex.html">
            
                    
                    VUEX规范
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >API规范</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="api&#x5F00;&#x53D1;&#x89C4;&#x8303;">api&#x5F00;&#x53D1;&#x89C4;&#x8303;</h1>
<p>&#x4EE5;&#x5F80;&#x7684;&#x5F00;&#x53D1;&#x4F1A;&#x628A;&#x6240;&#x6709;&#x4E0E;&#x540E;&#x53F0;&#x7684;&#x8BF7;&#x6C42;&#xFF0C;&#x6563;&#x843D;&#x5728;&#x6240;&#x6709;&#x4E1A;&#x52A1;&#x4EE3;&#x7801;&#x4E2D;&#xFF0C;&#x4E0D;&#x65B9;&#x4FBF;&#x7EF4;&#x62A4;&#x548C;&#x67E5;&#x627E;&#x3002;</p>
<p>&#x73B0;&#x628A;api&#x96C6;&#x4E2D;&#x7BA1;&#x7406;&#x8D77;&#x6765;&#xFF0C;&#x5E76;&#x63A8;&#x8350;&#x5206;&#x6A21;&#x5757;&#x6765;&#x7BA1;&#x7406;&#xFF0C;&#x6E05;&#x6670;&#x660E;&#x4E86;</p>
<h3 id="&#x5177;&#x4F53;&#x8BF4;&#x660E;">&#x5177;&#x4F53;&#x8BF4;&#x660E;</h3>
<p>&#x5728;&#x6BCF;&#x4E2A;&#x4E1A;&#x52A1;&#x6A21;&#x5757;&#x4E0B;&#xFF0C;&#x4F1A;&#x5EFA;&#x7ACB;&#x4E00;&#x4E2A;<code>apis</code>&#x7684;&#x76EE;&#x5F55;&#xFF0C;&#x8BE5;&#x76EE;&#x5F55;&#x4E0B;&#x5B58;&#x653E;&#x8FD9;&#x6240;&#x6709;api&#x5730;&#x5740;
&#x5176;&#x4E2D;<code>index.js</code>&#x662F;api&#x603B;&#x5165;&#x53E3;&#xFF0C;&#x8D1F;&#x8D23;&#x5F15;&#x5165;&#x5176;&#x4ED6;&#x6A21;&#x5757;&#x7684;api&#xFF0C;&#x5E76;&#x7EDF;&#x4E00;&#x5BF9;&#x5916;&#x63D0;&#x4F9B;&#x63A5;&#x53E3;</p>
<pre><code class="lang-js"><span class="hljs-comment">// &#x83DC;&#x5355;</span>
<span class="hljs-keyword">import</span> menu <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;./menu&apos;</span>;
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> {
    menu
}
</code></pre>
<p>menu.js</p>
<pre><code class="lang-js"><span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> {
    getMenuList: <span class="hljs-string">&apos;/demo/getMenuList&apos;</span>,
}
</code></pre>
<h4 id="&#x4F7F;&#x7528;api">&#x4F7F;&#x7528;api</h4>
<pre><code class="lang-js"><span class="hljs-keyword">import</span> apis <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;../apis&apos;</span>;
<span class="hljs-keyword">this</span>.$http.get(apis.menu.getMenuList,{
  params: {test:<span class="hljs-number">1</span>}
}).then((res)=&gt;{
  <span class="hljs-keyword">if</span>(res.data.success){
    <span class="hljs-keyword">this</span>.menuList = res.data.menuList;
  }
})
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="directory.html" class="navigation navigation-prev " aria-label="Previous page: 目录规划">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="ajax.html" class="navigation navigation-next " aria-label="Next page: ajax请求">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"API规范","level":"1.3","depth":1,"next":{"title":"ajax请求","level":"1.4","depth":1,"path":"ajax.md","ref":"ajax.md","articles":[]},"previous":{"title":"目录规划","level":"1.2","depth":1,"path":"directory.md","ref":"directory.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["livereload"],"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"api.md","mtime":"2020-03-17T12:55:56.699Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-03-19T06:12:42.684Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

